package com.xuecheng.media.domain.jobhandler;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-08-17  09:21
 */
@Component
public class SampleJob {

    @XxlJob("testJob")
    public void testJob(){
        System.out.println("测试任务");
    }

    @XxlJob("shardingJobHandlerTest")
    public void shardingJobHandlerTest(){
        Integer shardIndex = XxlJobHelper.getShardIndex();
        Integer shardTotal = XxlJobHelper.getShardTotal();
        System.out.println("分片广播测试：" + shardIndex + " " + shardTotal);
    }
}
